<template>
    <div id="transfer-success" class="bg-account">
        <div class="con-wrap bg-f success-top">
            <img src="/statics/home/images/icon-success.png" alt="success" class="pay-success">
            <p class="success-info">转账成功</p>
        </div>
        <img src="/statics/home/images/hr-img.png" alt="hr" class="hr-img">
        <div class="con-wrap flex-nowrap bg-f success-bottom">
            <div class="success-left">
                <p>订单编号：</p>
                <p>创建时间：</p>
                <p>付款账户：</p>
                <p>收款账户：</p>
                <p>转账金额：</p>
                <p>付款方式：</p>
            </div>
            <div class="success-right">
                <p>{{ detailInfo.order_sn }}</p>
                <p>{{ detailInfo.created_at }}</p>
                <p>{{ detailInfo.user.username }}</p>
                <p>{{ detailInfo.to_user.username }}</p>
                <p>{{ detailInfo.money }}</p>
                <p>代币支付</p>
            </div>
        </div>
        <a href="#/account/index" class="btn-1 btn-1-main">完成</a>
        <div class="btn-1 mt20" @click="back()">返回</div>
    </div>
</template>


<script>
export default {
    name: 'TransferSuccess',
    data() {
        return {
            detail_id:0,
            detailInfo:{
                order_sn:'',
                created_at:'',
                to_user:{
                    username:'',
                },
                user:{
                    username:'',
                },
                money:'',
            },
        }
    },
    created() {
        this.detail_id = this.$route.params.id;
        if(this.detail_id != 0){
            this.$api.transfer.detail({detail_id:this.detail_id,type:1}).then(res => {
                this.detailInfo = res.result
            }).finally(e => {});
        }else{
            let order_sn = this.$route.query.order_sn;
            this.$api.transfer.detail({order_sn:order_sn,type:2}).then(res => {
                this.detailInfo = res.result
            }).finally(e => {});
        }
    },
    methods: {
        back(){
            this.$router.go(-1)
        },
    }
}
</script>
